package com.xzkydz.serialport;

import android.content.Context;

import com.ky.serialport.bean.ComBean;
import com.ky.serialport.helper.SerialHelper;

import java.util.LinkedList;
import java.util.Queue;


public class SerialControl extends SerialHelper {


    public volatile Queue<ComBean> QueueList = new LinkedList<ComBean>();

    public SerialControl(Context context, int mDataType) {
        super(context, mDataType);
    }

    public SerialControl(Context context, String sPort, int sBaudRate, int mDataType) {
        super(context, sPort, sBaudRate, mDataType);
    }

    @Override
    protected void onDataReceived(ComBean ComRecData) {
        AddQueue(ComRecData);
    }

    public synchronized void AddQueue(ComBean ComData) {
        QueueList.add(ComData);
    }

}
